<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('编辑库存信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-stock-edit" th:object="${stock}">
            <input name="id" th:field="*{id}" type="hidden">
            <!--<div class="form-group">    -->
                <!--<label class="col-sm-3 control-label">商品信息id：</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<input name="goodsId" th:field="*{goodsId}" class="form-control" type="text">-->
                <!--</div>-->
            <!--</div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">商品编码：</label>
                <div class="col-sm-8">
                    <input name="goodsName" th:field="*{goodsCode}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="goodsName" th:field="*{goodsName}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">规格：</label>
                <div class="col-sm-8">
                    <input name="goodsFormat" th:field="*{goodsFormat}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">单位：</label>
                <div class="col-sm-8">
                    <select name="goodsUnit" class="form-control m-b" th:with="type=${@dict.getType('product_unit')}" readonly>
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{goodsUnit}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">安全库存：</label>
                <div class="col-sm-8">
                    <input name="safetyStock" th:field="*{safetyStock}" class="form-control" type="number">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">库存数量：</label>
                <div class="col-sm-8">
                    <input name="stockNumber" th:field="*{stockNumber}" class="form-control" type="number" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">锁定数量：</label>
                <div class="col-sm-8">
                    <input name="lockNumber" th:field="*{lockNumber}" class="form-control" type="number" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control" maxlength="200">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "store/stock";
        $("#form-stock-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-stock-edit').serialize());
            }
        }
    </script>
</body>
</html>